<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        let score = '88.8';
        // 1. 字符串转化为 number
        score = parseFloat(score);
        // score = parseInt(score);   
        console.log(score);         // 输出为88
        console.log(typeof score);
        // 2. not a number
        score = parseInt('你好');  // 输出为NaN
        console.log(score);

        // 3. 强制转化为 number
        let age = Number('123');
        console.log(typeof age);  // number
    </script>
</body>

</html>